
class LoginResponse {
  final int code;
  final String msg;
  final LoginData data;

  LoginResponse({required this.code, required this.msg, required this.data});

  factory LoginResponse.fromJson(Map<String, dynamic> json) {
    return LoginResponse(
      code: json['code'],
      msg: json['msg'],
      data: LoginData.fromJson(json['data']),
    );
  }
}

class LoginData {
  final int id;
  final String userId;
  final String parentId;
  final String userName;
  final String phone;
  final String email;
  final String country;
  final String address;
  final String role;
  final int status;
  final String phoneZone;
  final String zone;
  final String createTime;
  final String lastTime;
  final String uri;
  final int fun;
  final String code;
  final String host;
  final int show;
  final String chatBot;
  final String chatBotEn;

  LoginData({
    required this.id,
    required this.userId,
    required this.parentId,
    required this.userName,
    required this.phone,
    required this.email,
    required this.country,
    required this.address,
    required this.role,
    required this.status,
    required this.phoneZone,
    required this.zone,
    required this.createTime,
    required this.lastTime,
    required this.uri,
    required this.fun,
    required this.code,
    required this.host,
    required this.show,
    required this.chatBot,
    required this.chatBotEn,
  });

  factory LoginData.fromJson(Map<String, dynamic> json) {
    return LoginData(
      id: json['id'],
      userId: json['userId'] ?? '',
      parentId: json['parentId'] ?? '',
      userName: json['userName'] ?? '',
      phone: json['phone'] ?? '',
      email: json['email'] ?? '',
      country: json['country'] ?? '',
      address: json['address'] ?? '',
      role: json['role'] ?? '',
      status: json['status'] ?? 0,
      phoneZone: json['phoneZone'] ?? '',
      zone: json['zone'] ?? '',
      createTime: json['createTime'] ?? '',
      lastTime: json['lastTime'] ?? '',
      uri: json['uri'] ?? '',
      fun: json['fun'] ?? 0,
      code: json['code'] ?? '',
      host: json['host'] ?? '',
      show: json['show'] ?? 0,
      chatBot: json['chatBot'] ?? '',
      chatBotEn: json['chatBotEn'] ?? '',
    );
  }
}